<?php


namespace App\Models\MainDB;


use Illuminate\Database\Eloquent\Model;

class RoomRecommend extends Model
{
    protected $table = 'ln_recommend_room';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名

    protected $fillable = [
        'id',      //主键ID
        'room_id',         //房间id
        'type',         //1.系统标签  2.个人标签
        'user_code',         //用户code
        'recommend_type_id',
        'start_time',
        'end_time',
        'create_time',
        'update_time',
    ];

    public $timestamps = false;

    public function  user_data(){
        return $this->hasOne('App\Models\MainDB\UserData','user_code','user_code');
    }

    public function user_room()
    {
        return $this->hasOne('App\Models\MainDB\UserRoom','room_id','room_id');
    }
}